<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@ page language="java" import="java.util.*" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>


<script type='text/javascript' src='./dwr/interface/loginService.js'></script>
<script type='text/javascript' src='./dwr/engine.js'></script>
<script type='text/javascript' src='./dwr/util.js'></script>
<script language="javascript">
    function check4() {
        if (document.formlogin.loginname.value == "") {
            alert("请输入用户名");
            document.formlogin.loginname.focus();
            return false;
        }
        if (document.formlogin.loginpw.value == "") {
            alert("请输入密码");
            document.formlogin.loginpw.focus();
            return false;
        }
        if (document.formlogin.yzm.value == "") {
            alert("请输入密码");
            document.formlogin.yzm.focus();
            return false;
        }

        loginService.login4(document.formlogin.loginname.value, document.formlogin.loginpw.value, document.formlogin.type.value, document.formlogin.yzm.value, callback);
    }

    function callback(data) {
        //document.getElementById("indicator").style.display="none";
        if (data == "yanzhenmacuowu") {
            alert("验证码输入错误");
        }
        if (data == "no") {
            alert("用户名或密码错误");
        }
        if (data == "yes") {
            alert("通过验证,系统登录成功");
            window.location.href = "./default.jsp";
        }

    }

    function userLogout() {
        loginService.userLogout(callback_logout);
    }

    function callback_logout(data) {
        alert("成功退出系统");
        window.location.href = "./default.jsp";
    }

</script>

<div class="itop">
    <div class="itopc">
        <div class="itopcl"><span>欢迎进入!</span></div>
        <div class="itopcr">
            <div align="right">
                <c:if test="${sessionScope.user==null}">
                    <a href="userlog.jsp">用户登陆</a><span>|</span><a href="usersAddQian.jsp">用户注册</a>
                </c:if>
                <c:if test="${sessionScope.user!=null}">
                    当前用户:${sessionScope.user.loginname},权限:${sessionScope.user.typename};
                    <a href="userlogout.jsp">退出</a>|<a href="main.jsp">个人后台</a>
                </c:if>
            </div>
        </div>
    </div>
</div>
<div class="ilogo">
    <div class="ilogoc">
        <div class="ilogol"><img src="qtimages/timg.jpg" width="70" height="65"/>
            <p><strong>食堂订餐系统</strong><br>
                <span>全力打造,精心呵护</span></p>
        </div>
        <div class="ilogor">
            <p>咨询热线：<br>
                <strong>400-xxxx-xxxx</strong></p>
        </div>
        <div class="clear"></div>
    </div>
</div>

<div id="hsgbanner">
    <div class="navgrp">

        <ul class="nav" id="nav">

            <li class="cur"><a href="default.jsp">网站首页</a></li>
            <li><a href="dx?typec=dxManaQian">系统简介</a></li>
            <li><a href="gonggao?typec=gonggaoManaQiantp">公告</a></li>

            <li><a href="shangpin?typec=shangpinManaQian">菜品信息</a></li>

            <li><a style="cursor:pointer">在线留言</a>
                <div id="navChild">
                    <a href="liuyanAddQian.jsp">在线留言</a>
                    <a href="liuyan?typec=liuyanManaQian">查看留言</a>
                </div>
            </li>
            <li><a href="usersAddQian.jsp">用户注册</a> </li>

            <li><a href="login.jsp">后台管理</a></li>
        </ul>
    </div>
</div>


